import HTTP from '../../../../utils/http.js';
import { API, API_GENERATE } from '../../../../config/api.js';

class OrderTurnService {
	getFindList (params = {}) {
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_LIST), params);
	}
	getDetails (params = {}) {
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_DETAIL), params);
	}
	getPool (params = {}) {
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_POOL), params);
	}
	getOrderList (params = {}) {
		return HTTP.POST(API_GENERATE(API.GET_ORDER_LIST), params);
	}
	claimList (params = {}) {  //资源意向认领列表 
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_CLAIM_LIST), params);
	}
	claimNum (params = {}) { //资源意向认领列表 统计数
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_CLAIM_LIST_NUM), params);
	}
	confirm (params = {}) {  //资源意向认领列表
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_CLAIM_CONFIRM), params);
	}
	cancel (params = {}) {  //资源意向认领撤销
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_CLAIM_CANCEL), params);
	}
	mergeList (params = {}) { //获取意向资源已认领列表
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_MERGE_LIST), params);
	}
	merge (params = {}) { //点击合并按钮
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_MERGE_MERGE), params, {
			rejectError: true, //是否将错误数据以reject的方式返回
			handerError: false //统一出错处理 通过toast提示
		});
	}
	findMerge (params = {}) { //点击合并按钮
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_FIND_MERGE), params);
	}
	goodsMerge (params = {}) {//商品合并查看
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_MERGE_GOODS), params);
	}
	goodsMergeSubmit (params = {}) {//商品合并提交
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_MERGE_GOODS_SUBMIT), params);
	}
	setOrderType (params = {}) {
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_SET_TYPE), params, {
			rejectError: true, //是否将错误数据以reject的方式返回
			handerError: false //统一出错处理 通过toast提示
		});
	}
	isLong (params = {}) {
		return HTTP.POST(API_GENERATE(API.ORDER_TURN_LONGORDER), params, {
			rejectError: false, //是否将错误数据以reject的方式返回
			handerError: false //统一出错处理 通过toast提示
		});
	}
}
module.exports = new OrderTurnService();